import App from '@/App.vue'
import directive from '@/directive'
import router from '@/router'
import pinia from '@/stores'
import ArcoVue, { Card, Modal } from '@arco-design/web-vue'
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
import { BarChart, LineChart, PieChart } from 'echarts/charts'
import {
  GridComponent,
  LegendComponent,
  TitleComponent,
  TooltipComponent,
} from 'echarts/components'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { createApp } from 'vue'
import 'virtual:uno.css'
// import 'virtual:svg-icons-register'
import '@/styles/index.less'

use([
  CanvasRenderer,
  PieChart,
  BarChart,
  LineChart,
  TitleComponent,
  TooltipComponent,
  LegendComponent,
  GridComponent,
])

const app = createApp(App)
// 对特定组件进行默认配置
Card.props.bordered = false
// 解决Modal.open打开页面，arco组件无法渲染的问题
Modal._context = app._context

app.use(ArcoVue, {})
app.use(ArcoVueIcon)

app.use(router)
app.use(pinia)
// app.use(globalComponents);
app.use(directive)

app.mount('#app')
